Aspx.cs:
using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
namespace WebApplication1
{
public partial class PR10 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnpartial_Click(object sender, EventArgs e)
{
string t1 = DateTime.Now.ToLongTimeString();
lblpartial.Text = "Showing time from panel control" + t1;
lbltotal.Text = "Showing time from outside the panel" + t1;
}
protected void btntotal_Click(object sender, EventArgs e)
{
string t1 = DateTime.Now.ToLongTimeString();
lblpartial.Text = "Showing time from panel control" + t1;
lbltotal.Text = "Showing time from outside the panel" + t1;
}
}
}
.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PR10.aspx.cs" Inherits="WebApplication1.PR10" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="btnpartial" runat="server" Text="Partial Postback" OnClick="btnpartial_Click" />
<br /><br />
<asp:Label ID="lblpartial" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<p></p>
<p>out of update panel</p>
<p>
<asp:Button ID="btntotal" runat="server" Text="TotalPostBack" OnClick="btntotal_Click" />
</p>
<asp:Label ID="lbltotal" runat="server" Text=""></asp:Label>
</form>
</body>
</html>
OUTPUT:
0 Comments